package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * @author LinYinDong
 * @date 2024/8/26 下午2:16
 */
@Getter
public enum SettleResultItemEnum {
    BALANCE_RECHARGE(0, "未打款"),
    ORDER_SETTLEMENT(1, "打款成功"),
    ORDER_REFUND(2, "打款失败"),
    SEND_WELFARE(3, "取消打款"),
    ;

    private Integer code;
    private String desc;

    SettleResultItemEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String formatDesc(Integer code){
        SettleResultItemEnum[] values = SettleResultItemEnum.values();
        String desc = null;
        for (int i = 0; i < values.length; i++) {
            if (values[i].code.compareTo(code) == 0){
                desc = values[i].desc;
                break;
            }
        }
        return desc;
    }
}
